home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / IM_Install3.adf / piarc.LZH / postiv.rexx < prev    next >
OS/2 REXX Batch file  |  1992-08-20  |  2KB  |  98 lines

  1. /*
  2.  * postiv.rexx  -  script to drive single-frame recorder!
  3.  */
  4.  
  5. /* 
  6.  * Always include this block of code which can load the libraries:
  7.  */
  8. if ~show('L',"rexxsupport.library") then do
  9.   if addlib('rexxsupport.library',0,-30,0) then do
  10.       /* everything's ok */
  11.     end;
  12.   else do
  13.     say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
  14.     say 'Cannot operate this module without the library - sorry!';
  15.     exit 10;
  16.     end;
  17.   end;
  18.  
  19. prtnme = 'IM_Port';
  20. sfcnme = 'BCDAREXX.PORT';
  21. ivname = 'IMIV24';
  22.  
  23. cmdpath = 'c:';
  24. if open(fhandle,'rexx:picmdpath','read') then do /* open the file */
  25.     cmdpath = readln(fhandle);
  26.     call close(fhandle);  /* close the file    */
  27.   end
  28.  
  29. address(prtnme);      /* communicate with image processor we found */
  30. themode = 0; /* selects leave scale alone */
  31.  
  32.  theres = 0; /* select high resolution (1)   */
  33. thelace = 1; /* selects interlace  (1)       */
  34. thescan = 1; /* selects overscan (1)         */
  35.  
  36. plist = showlist('p'); /* is SFC active??? */
  37. if index(plist,sfcnme) = 0 then do
  38.   'message Oh No! No Single Frame Recorder ARexx Port!!!';
  39.   exit 0;
  40.   end;
  41.  
  42. options results;
  43. 'current';
  44. parse var result bname ',' bnum ',' breast;
  45. 'jackin';             /* attach to image processor's internal data structure */
  46. jackptr = result;     /* fetch the return value from the std ARexx return    */
  47. options;              /* disallow return values from further commands        */
  48. 'lockimage '||bnum;
  49. address command run cmdpath||'imiv24 '||jackptr||' '||theres||' '||thelace||' '||thescan||' '||themode||' '||pal;
  50.  
  51. /*
  52.  * wait for port to show up!
  53.  */
  54. plist = showlist('p');
  55. loopc = 0;
  56. do while index(plist,ivname) = 0
  57.   call delay(50); /* tick a second at a time */
  58.   plist = showlist('p');
  59.   loopc = loopc+1;
  60.   if loopc = 60 then do
  61.     'unlockimage '||bnum;
  62.     exit 0;
  63.     end;
  64.   end;
  65. /*
  66.  * We have the port; now we have to send the image to the SFR.
  67.  */
  68.  
  69. target = 5400;
  70. if show('C',sfctarget) = 1 then do
  71.   target = getclip(sfctarget);
  72.   end;
  73.  
  74. incr = 1;
  75. if show('C',sfcincr) = 1 then do
  76.   incr = getclip(sfcincr);
  77.   end;
  78.  
  79. address(sfcnme);
  80. '-x EDTP 5';
  81. '-x EDOT '||target;
  82. '-x APND '||incr;
  83.  
  84. target = target + incr;
  85. call setclip(sfctarget,target);
  86.  
  87. dtime = 50 * 12;
  88. call delay(dtime); /* wait for SFR to record */
  89. address 'IMIV24' 'quit'; /* terminate iv24 display operation */
  90.  
  91. /*
  92.  * Finally, since the image has been recorded, we can now unlock the
  93.  * buffer for future operations.
  94.  */
  95. address(prtnme);
  96. 'unlockimage '||bnum;
  97. 'finish';
  98.